home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 22 / PC Actual CD 22.iso / SHARE / prog / POVRAY / E-P-O.ZIP / E-P-O.POV < prev    next >
Encoding:
Text File  |  1996-10-31  |  14.4 KB  |  538 lines

  1.  
  2. //------------------------------------------------------------------->
  3. //
  4. // e-p-o.pov
  5. //
  6. // "Easy POV Oven"
  7. //
  8. // Written By: Paul T. Dawson
  9. //             ptdawson@voicenet.com
  10. //             http://www.voicenet.com/~ptdawson
  11. //
  12. // All code and techniques are PUBLIC DOMAIN - have fun with it!
  13. //
  14. //------------------------------------------------------------------->
  15. //
  16. // Remember to turn these all "on" for the final render!
  17.  
  18.         #declare Show_Floor    = on
  19.         #declare Show_Outdoors = on
  20.         #declare Show_Oven     = on
  21.         #declare Show_People   = on
  22.         #declare Show_Screen   = on
  23.         #declare Show_Table    = on
  24.         #declare Show_Thing_1  = on
  25.         #declare Show_Thing_2  = on
  26.         #declare Show_Thing_3  = on
  27.         #declare Show_Thing_4  = on
  28.         #declare Show_Thing_5  = on
  29.         #declare Show_Thing_6  = on
  30.         #declare Show_Walls    = on
  31.         #declare Show_Wires    = on
  32.  
  33.         #declare Which_Camera = 1
  34.  
  35. //------------------------------------------------------------------->
  36. //
  37. // All of the usual initializing.
  38.  
  39.         #include "colors.inc"
  40.         #include "textures.inc"
  41.         #include "metals.inc"
  42.         #include "skies.inc"
  43.         #include "woods.inc"
  44.         #include "stones.inc"
  45.  
  46.         #default { finish { Shiny } }
  47.         background { White }
  48.  
  49. //------------------------------------------------------------------->
  50. //
  51. // Camera #1 is the "final" setting, #2 is for testing!
  52.  
  53.         #if ( Which_Camera = 1 )
  54.                 camera { location < 4.5*12, 6*12, -4*12 >
  55.                         look_at < 0, 2.5*12, 0 > }
  56.         #end
  57.  
  58.         #if ( Which_Camera = 2 )
  59.                 camera { location < 4.5*12, 14*12, -16*12 >
  60.                         look_at < 0, 2.5*12, 0 > }
  61.         #end
  62.  
  63. //------------------------------------------------------------------->
  64. //
  65. // Lights.
  66.  
  67.         // Four main lights.
  68.         light_source { < -5*12, 7*12, -5*12 > color rgb 1.0 }
  69.         light_source { < -5*12, 7*12,  5*12 > color rgb 1.0 }
  70.         light_source { <  5*12, 7*12, -5*12 > color rgb 1.0 }
  71.         light_source { <  5*12, 7*12,  5*12 > color rgb 1.0 }
  72.  
  73.         // One way up high.
  74.         light_source { <  0*12, 200*12,  0*12 > color rgb 1.0 }
  75.  
  76.         // One halfway across.
  77.         light_source { <  0*12, 7*12,  -5*12 > color rgb 1.0 }
  78.  
  79. //------------------------------------------------------------------->
  80. //
  81. // Miscellaneous variables.
  82.  
  83.         #declare P4_RAND = seed(0)
  84.         #declare R1 = seed(0)
  85.  
  86.         #declare Count_Triangles = 0
  87.         #declare Count_Wall = 0
  88.         #declare Count_Floor = 0
  89.         #declare Count_Temp = 0
  90.  
  91. //------------------------------------------------------------------->
  92. //
  93. // Always include the baking pan, since it's used in several places.
  94.  
  95.         #include "bake-pan.inc"
  96.  
  97. //------------------------------------------------------------------->
  98. //
  99. // The floor.
  100.  
  101. #if ( Show_Floor = on )
  102.  
  103.         // Floor tiles.
  104.  
  105.                 #include "floor.inc"
  106.  
  107.                 #declare X = -7*12 #while ( X <= 6*12 )
  108.                 #declare Z = -6*12 #while ( Z <= 7*12 )
  109.  
  110.                         object { Floor_Tile translate < X, 0, Z > }
  111.                         #declare Count_Floor = Count_Floor + 1
  112.  
  113.                 #declare Z = Z + 1*12 #end
  114.                 #declare X = X + 1*12 #end
  115.  
  116.         // This hides any gaps.
  117.  
  118.                 box { < -10*12, -1*12, -10*12 > < 10*12, -2*12, 10*12 >
  119.                         pigment { Gray10 } }
  120.  
  121.         // Add the triangles to the grand total.
  122.                 #declare Count_Triangles = Count_Triangles +
  123.                         ( Count_Floor * Count_Temp )
  124.  
  125.  
  126. #end
  127.  
  128. //------------------------------------------------------------------->
  129. //
  130. // The Great Outdoors (tm).
  131.  
  132. #if ( Show_Outdoors = on )
  133.  
  134.                 sky_sphere { S_Cloud2 }
  135.  
  136. #end
  137.  
  138. //------------------------------------------------------------------->
  139. //
  140. // The oven.
  141.  
  142. #if ( Show_Oven = on )
  143.  
  144.         #include "oven.inc"
  145.  
  146.         object { Oven translate y*(2.5*12)
  147.                 rotate y * -20
  148.                 translate x * (1*12) }
  149.  
  150.         // Show baking pan halfway out of oven.
  151.                 object { Baking_Pan translate <15, 12.2, 0>
  152.                         // Spin it same as oven!
  153.                                 translate y*(2.5*12)
  154.                                 rotate y * -20
  155.                                 translate x * (1*12) }
  156.  
  157. #end
  158.  
  159. //------------------------------------------------------------------->
  160. //
  161. // The people.
  162.  
  163. #if ( Show_People = on )
  164.  
  165.         // Julie.
  166.         #include "p4def_01.inc"
  167.         object{One_Person rotate y*-190 translate < -2.4*12, 0, -2.5*12 > }
  168.  
  169.         // Tony.
  170.         #include "p4def_02.inc"
  171.         object{One_Person rotate y*1 translate<1.8*12,0,3*12>}
  172.  
  173. #end
  174.  
  175. //------------------------------------------------------------------->
  176. //
  177. // The screen that shows the TGA of the first thing.
  178. //
  179. // Note: If you get an error in this section, it's probably because the
  180. //       required TGA file is missing. Run TEST-1.POV at a resolution
  181. //       of 200x150 to create TEST-1.TGA.
  182.  
  183.  
  184. #if ( Show_Screen = on )
  185.  
  186.         #include "screen.inc"
  187.  
  188.         object { Screen
  189.                 rotate y * -20
  190.                 translate < -2.8*12, 2.5*12, -0.5*12 > }
  191.  
  192. #end
  193.  
  194.  
  195. //------------------------------------------------------------------->
  196. //
  197. // The table.
  198.  
  199. #if ( Show_Table = on )
  200.  
  201.         #include "table.inc"
  202.  
  203.         object { Table rotate y*10 }
  204.  
  205. #end
  206.  
  207. //------------------------------------------------------------------->
  208. //
  209. // The first thing (curly halfway out of oven).
  210.  
  211. #if ( Show_Thing_1 = on )
  212.  
  213.         #include"thing-1.inc"
  214.  
  215.         object { Thing_1
  216.  
  217.                 // Make it a little bigger.
  218.                         scale 1.2
  219.  
  220.                 // Move it to edge of tunnel.
  221.                         translate < 15, 13.5, 0 >
  222.  
  223.                 // Spin it same as oven!
  224.                         translate y * ( 2.5 * 12 )
  225.                         rotate y * -20
  226.                         translate x * (1*12)
  227.  
  228.                 } // End of object.
  229.  
  230. #end
  231.  
  232. //------------------------------------------------------------------->
  233. //
  234. // The second thing (fractori).
  235.  
  236. #if ( Show_Thing_2 = on )
  237.  
  238.         #declare Thing_2_Loc = < 2.9*12, 2.5*12, -1.7*12 >
  239.  
  240.         #include "thing-2.inc"
  241.  
  242.         object { Thing_2
  243.  
  244.                 // Move it into baking pan.
  245.                         scale 0.15 translate y*1.5
  246.  
  247.                 // Move it to same place as baking pan.
  248.                         translate Thing_2_Loc
  249.  
  250.                 } // End of object.
  251.  
  252.         object { Baking_Pan
  253.  
  254.                 rotate y*-10
  255.                 translate Thing_2_Loc
  256.  
  257.                 } // End of object.
  258.  
  259. #end
  260.  
  261. //------------------------------------------------------------------->
  262. //
  263. // The third thing (checkerboard with mirror spheres).
  264.  
  265. #if ( Show_Thing_3 = on )
  266.  
  267.         #declare Thing_3_Loc = < 0.7*12, 2.5*12, -1.8*12 >
  268.  
  269.         #include "thing-3.inc"
  270.  
  271.         object { Thing_3
  272.  
  273.                 // Move it to same place as baking pan.
  274.                         translate Thing_3_Loc
  275.  
  276.                 } // End of object.
  277.  
  278.         object { Baking_Pan
  279.  
  280.                 rotate y*-20
  281.                 translate Thing_3_Loc
  282.  
  283.                 } // End of object.
  284.  
  285. #end
  286.  
  287. //------------------------------------------------------------------->
  288. //
  289. // The fourth thing (a bunch of spheres).
  290.  
  291. #if ( Show_Thing_4 = on )
  292.  
  293.         #declare Thing_4_Loc = < 3.2*12, 2.5*12, 0.7*12 >
  294.  
  295.         #include "thing-4.inc"
  296.  
  297.         object { Thing_4
  298.  
  299.                 // Move it to same place as baking pan.
  300.                         translate Thing_4_Loc
  301.  
  302.                 } // End of object.
  303.  
  304.         object { Baking_Pan
  305.  
  306.                 rotate y*-10
  307.                 translate Thing_4_Loc
  308.  
  309.                 } // End of object.
  310.  
  311. #end
  312.  
  313. //------------------------------------------------------------------->
  314. //
  315. // The fifth thing (a tray of plastic people).
  316.  
  317. #if ( Show_Thing_5 = on )
  318.  
  319.         #declare Thing_5_Loc = < 2.8*12, 2.5*12, -0.5*12 >
  320.  
  321.         #include "thing-5.inc"
  322.  
  323.         object { Thing_5
  324.  
  325.                 // Move it to same place as baking pan.
  326.                         translate Thing_5_Loc
  327.  
  328.                 } // End of object.
  329.  
  330.         object { Baking_Pan
  331.  
  332.                 rotate y * 25
  333.                 translate Thing_5_Loc
  334.  
  335.                 } // End of object.
  336.  
  337. #end
  338.  
  339. //------------------------------------------------------------------->
  340. //
  341. // The sixth thing (a big mirror sphere).
  342.  
  343. #if ( Show_Thing_6 = on )
  344.  
  345.         #declare Thing_6_Loc = < 1.8*12, 2.5*12, -1.7*12 >
  346.  
  347.         #include "thing-6.inc"
  348.  
  349.         object { Thing_6 rotate y * 120
  350.  
  351.                 // Move it to same place as baking pan.
  352.                         translate Thing_6_Loc
  353.  
  354.                 } // End of object.
  355.  
  356.         object { Baking_Pan
  357.  
  358.                 rotate y * -5
  359.                 translate Thing_6_Loc
  360.  
  361.                 } // End of object.
  362.  
  363. #end
  364.  
  365. //------------------------------------------------------------------->
  366. //
  367. // The four walls.
  368.  
  369. #if ( Show_Walls = on )
  370.  
  371.         #include "wall.inc"
  372.  
  373. // Left side wall.
  374.  
  375.         #declare Z = -6 #while ( Z <= 7 )
  376.         #declare Y = 0 #while ( Y <= 6 )
  377.  
  378.                         object { Wall_Tile
  379.  
  380.                                 // Spin it around.
  381.                                 translate < -6, -6, 0 >
  382.                                 rotate z * ( 90 * int ( rand(R1)*100 ) )
  383.                                 translate < 6, 6, 0 >
  384.  
  385.                                 rotate <0,-90,0>
  386.                                 translate < -7*12, Y*12, Z*12 >
  387.  
  388.                                 } // End of object.
  389.  
  390.                         #declare Count_Wall = Count_Wall + 1
  391.  
  392.         #declare Y = Y + 1 #end
  393.         #declare Z = Z + 1 #end
  394.  
  395. // Rear wall.
  396.  
  397.         #declare X = -7 #while ( X <= 6 )
  398.         #declare Y = 0 #while ( Y <= 6 )
  399.  
  400.                         object { Wall_Tile
  401.  
  402.                                 // Spin it around.
  403.                                 translate < -6, -6, 0 >
  404.                                 rotate z * ( 90 * int ( rand(R1)*100 ) )
  405.                                 translate < 6, 6, 0 >
  406.  
  407.                                 translate < X*12, Y*12, 8*12 >
  408.  
  409.                                 } // End of object.
  410.  
  411.                         #declare Count_Wall = Count_Wall + 1
  412.  
  413.         #declare Y = Y + 1 #end
  414.         #declare X = X + 1 #end
  415.  
  416. // Right side wall.
  417.  
  418.         #declare Z = -6 #while ( Z <= 7 )
  419.         #declare Y = 0 #while ( Y <= 6 )
  420.  
  421.                         object { Wall_Tile
  422.  
  423.                                 // Spin it around.
  424.                                 translate < -6, -6, 0 >
  425.                                 rotate z * ( 90 * int ( rand(R1)*100 ) )
  426.                                 translate < 6, 6, 0 >
  427.  
  428.                                 rotate < 0, 90, 0 >
  429.                                 translate < 7*12, Y*12, (Z+1)*12 >
  430.  
  431.                                 } // End of object.
  432.  
  433.                         #declare Count_Wall = Count_Wall + 1
  434.  
  435.         #declare Y = Y + 1 #end
  436.         #declare Z = Z + 1 #end
  437.  
  438. // Front wall.
  439.  
  440.         #declare X = -7 #while ( X <= 6 )
  441.         #declare Y = 0 #while ( Y <= 6 )
  442.  
  443.                         object { Wall_Tile
  444.  
  445.                                 // Spin it around.
  446.                                 translate < -6, -6, 0 >
  447.                                 rotate z * ( 90 * int ( rand(R1)*100 ) )
  448.                                 translate < 6, 6, 0 >
  449.  
  450.                                 rotate y * 180
  451.                                 translate < (X+1)*12, Y*12, -6*12 >
  452.  
  453.                                 } // End of object.
  454.  
  455.                         #declare Count_Wall = Count_Wall + 1
  456.  
  457.         #declare Y = Y + 1 #end
  458.         #declare X = X + 1 #end
  459.  
  460. // Add the triangles to the grand total.
  461.  
  462.         #declare Count_Triangles = Count_Triangles +
  463.                 ( Count_Wall * Count_Temp )
  464.  
  465. #end
  466.  
  467. //------------------------------------------------------------------->
  468. //
  469. // The jumbled wires.
  470.  
  471. #if ( Show_Wires = on )
  472.  
  473.         #include "wires.inc"
  474.  
  475.         object { Wires scale < 1, 1, 0.5 >
  476.  
  477.                 // Move to front of original oven.
  478.                         translate < -7.5, 0.8, -6 >
  479.  
  480.                 // Now move to new oven location.
  481.                         translate y * (2.5*12)
  482.                         rotate y * -20
  483.                         translate x * (1*12)
  484.  
  485.                 } // End of object.
  486.  
  487.         // Big computer chip.
  488.                 union {
  489.  
  490.                 // Base.
  491.                 box { <0,0,0><6,2,6>
  492.                         pigment { Gray50 }
  493.                         normal { crackle 0.1 scale 0.1 }
  494.                         } // End of box.
  495.  
  496.                 // CPU.
  497.                 box { <0.5,2.5,0.5><5.5,3,5.5>
  498.                         pigment { image_map{gif "cpu.gif" interpolate 2 }
  499.                                 scale<6,6,6> rotate x*90 }
  500.                         } // End of box.
  501.  
  502.                 // Gold pins.
  503.                 box { <0.5,2,0.5><5.5,2.5,5.5>
  504.                         pigment{checker BrightGold,Black scale<0.1,100,0.1>}
  505.                         } // End of box.
  506.  
  507.                 // Connector to laptop.
  508.                 cylinder {<1,1, 6>< 1,1,10>,0.5 pigment{SteelBlue}}
  509.                 cylinder {<1,1,10><-8,1,10>,0.5 pigment{SteelBlue}}
  510.                 sphere {<1,1,10>,0.5 pigment{SteelBlue}}
  511.  
  512.                         // Move to left of original oven.
  513.                                 translate < -23, 0, -5 >
  514.                         // Now move to new oven location.
  515.                                 translate y*(2.5*12)
  516.                                 rotate y * -20
  517.                                 translate x * (1*12)
  518.  
  519.                 } // End of union.
  520.  
  521. #end
  522.  
  523. //------------------------------------------------------------------->
  524. //
  525. // Show the grand total of triangles.
  526.  
  527.         #debug concat ( "Number of floor blocks: ",
  528.                 str ( Count_Floor, 0, 0 ), "\n" )
  529.         #debug concat ( " Number of wall blocks: ",
  530.                 str ( Count_Wall, 0, 0 ), "\n" )
  531.         #debug concat ( "   Number of triangles: ",
  532.                 str ( Count_Triangles, 0, 0 ), "\n" )
  533.  
  534. //------------------------------------------------------------------->
  535. //
  536. // End of this file.
  537.  
  538.